using System;
using System.Collections.Generic;
using System.Text;

namespace Rocket.Core.Common
{
    /// <summary>
    /// The class that can be used to generalize the response object. 
    /// <example>
    /// The following code illustrates how to use this object:
    /// <pre>
    /// 	SabreResponse GetMyData()
    ///     {
    ///         RocketResponse response = new RocketResponse();
    ///         try
    ///         {
    ///             // Do the operation and get the required value to be returned
    ///             response.ReturnValue = blablabla;
    ///             response.StatusCode = StatusCode.Successful;
    ///             response.Message = "There are no maching records found in the database";
    ///             return response;
    ///         }
    ///         catch (Exception e)
    ///         {
    ///             response.StatusCode = StatusCode.Failed;
    ///             response.Message = e.Message;             
    ///             return response;
    ///         }
    ///     }
    /// </pre>
    /// </example>
    /// </summary>
    public class RocketResponse
    {
        public RocketResponse(StatusCodes statusCode, string message)
        {
            this._statusCode = statusCode;
            this._message = message;
        }

        private StatusCodes _statusCode;
        /// <summary>
        /// Status code represent whether the 
        /// operation is succussfull or failed.
        /// When a operation is failed the Message 
        /// property carries the details of the failures.
        /// </summary>
        public StatusCodes StatusCode
        {
            get { return _statusCode; }
            set { _statusCode = value; }
        }

        private string _message;
        /// <summary>
        /// When an operation failed, 
        /// this property carries the details of the failure
        /// </summary>
        public string Message
        {
            get { return _message; }
            set { _message = value; }
        }

        private object returnValue;
        /// <summary>
        /// The return code that carries return values
        /// </summary>
        public object ReturnValue
        {
            get { return returnValue; }
            set { returnValue = value; }
        }
    }
}
